import requests

def testlogin():
    logindata={"username":"qiao111","password":123}
    head={"Content-Type":"application/x-www-form-urlencoded"}
    r=requests.post("http://124.222.181.200:8081/login",headers=head,data=logindata,timeout=2)
    #获取 cookie第一种方式
    #r.cookies['JSESSIONID']
    #获取cookie第二种方式
    cookie=requests.utils.dict_from_cookiejar(r.cookies)
    return cookie['JSESSIONID']
    #return r.cookies['JSESSIONID']